package com.eqdd.yiqidian.ui.companyspace

import com.eqdd.yiqidian.bean.rebuild.slimedit.SlimEditEnterBean
import com.eqdd.yiqidian.bean.rebuild.slimedit.SlimImageSelectBean
import com.eqdd.yiqidian.http.HttpConfig
import com.eqdd.yiqidian.ui.companyspace.base.BaseSpaceAddActivity
import com.lzy.okgo.model.HttpParams
import java.io.File


/**
 * Created by jhj on 18-6-25.
 */
class TeamMemberAddActivity : BaseSpaceAddActivity() {
    override val title: String
        get() = "新增成员"
    override val url: String
        get() = HttpConfig.BASE_URL + HttpConfig.TEAM_MEMBER_ADD

    override fun uploadParams(): HttpParams {
        val params = HttpParams()
        val bean = slimAdapterEx.data
        params.put("userName", bean[1].content)
        params.put("PostMsg", bean[2].content)
        params.put("Msg", bean[3].content)
        bean[0].tag?.let {
            params.put("image", File(bean[0].tag as? String))
        }
        return params
    }

    override fun setEditBeans() {
        datas.add(SlimImageSelectBean("头像", 0, "").setDeal(true).setNeed(true))
        datas.add(SlimEditEnterBean("姓名", "", 1, "请输入").setNeed(true))
        datas.add(SlimEditEnterBean("职位", "", 2, "请输入").setNeed(true))
        datas.add(SlimEditEnterBean("简介", "", 3, "请输入").setNeed(true))
    }
}